<template>
   <div class="com-contain">
     <div class="com-chart" ref="sel"></div>
  </div>
</template>

<script>
export default {
   data () {
       return {
           chartinit:null,
           sellerNames:null,
           sellerValues:null
       }
   },

   mounted(){
       this.initEcharts()
       this.updateChart()
   },
   methods:{

       initEcharts(){
          this.chartinit = this.$echarts.init(this.$refs.sel)
       },
       //获取数据
       getList(){},

       //更新
       updateChart(){
           this.sellerNames = ['商家1','商家2','商家3','商家4','商家5']
           this.sellerValues = [100,2000,3000,4000,500]
           const options = {
               xAxis:{
                   type:'category',
                    data:this.sellerNames
               },
               yAxis:{
                   type:'value',
                  
               },
               series:[
                   {
                     type:'line',
                     data:this.sellerValues
                   }
               ]
           }
           this.chartinit.setOption(options)
       }
   }
}
</script>

<style>

</style>